home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5238 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: cville-srv.wam.umd.edu!jsquires
  2. From: jsquires@wam.umd.edu (jeffrey d squires)
  3. Newsgroups: comp.lang.c
  4. Subject: Limit on #bytes inside of struct?
  5. Date: 9 Feb 1996 03:45:49 GMT
  6. Organization: University of Maryland College Park
  7. Message-ID: <4feg1d$d4g@cville-srv.wam.umd.edu>
  8. NNTP-Posting-Host: rac6.wam.umd.edu
  9. X-Newsreader: TIN [version 1.2 PL0]
  10.  
  11. I have the following:
  12.  
  13. typedef struct {
  14.         int zero;
  15.         int one;
  16.         int two;
  17.         int three;
  18.         int four;
  19.         int five;
  20.         int six;
  21.         int seven_or_more;
  22. } hist_type;
  23.  
  24. hist_type histogram;
  25. int num=2;
  26.  
  27. histogram.zero = 0;
  28. histogram.one = 0;
  29. histogram.two = 0;
  30. histogram.three = 0;
  31. histogram.four = 0;  /* at this point, value of num changes from 2 to 0!!!*/
  32.  
  33. Is there a limit on the number of bytes allowed inside of a struct?
  34. I am positive that the value of num changes from 2 before the last 
  35. assignment to 0 after it.  Any ideas?  Is this a bug in gcc?  Unix?
  36.  
  37. This is completely crazy!  
  38.  
  39. Thanks in advance for your response,
  40.  
  41.     Jeff Squires
  42.     jsquires@umiacs.umd.edu
  43.  
  44.  
  45.